SC_rayCast

SYNTAX
return integer=SC_rayCast ( objNum, oldx, oldy, oldz, x, y, z, excludeObj )

-objNum: the object you want to check for collision use 0 for all objects
-oldx...z: the start and end points of the ray to check.
-excludeObj: an object to exclude from the collision check.
returns: if objNum=0 then the object number collided with is returned
if checking a specific object then a 1 is returned if a collision occured.
returns 0 if no collision occured.

will check if the ray starting at oldx#,oldy#,oldz# and ending at
x#,y#,z# collides with the specified object (obj=0 for all).
does not collide with backfaces, will return the number of the object
hit first, or 0 for no collision.

Ray casting commands are useful for calculating the collisions of bullets with
levels and objects, or for representing the line of sight of an enemy to detect
if they can see the player.


RELATED INFO
Collision Commands Menu
Index